/**
 * @Author: Bobby
 * @Date: 2022-03-22 14:49:36
 * @LastEditTime: 2022-03-22 17:38:09
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\utils\resetPageInfo.js
 * @CIMC-V2
 */
import isEmpty from 'lodash/isEmpty'
import { getModel, recursiveList } from '@ve/utils/utils'
//重置所有pageinfo 组件
export function resetAllPageInfo(data) {
  const pageInfo = data
  let _layerList = recursiveList([pageInfo])
  //组件
  for (let i = 0; i < _layerList.length; i++) {
    //uiForm 重置formData
    let _info = getModel(_layerList[i]['pageModules'], 'uiForm', 'type')
    if (!isEmpty(_info)) {
      _info.data.formData = {}
    }
  }
  return pageInfo
}
